var express = require('express');
const { route } = require('./users');
const { JSONCookies } = require('cookie-parser');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express Get' });
});

router.post('/', function(req, res, next) {
  res.send({code:0, message:"success", data:"post request"});
});

router.get('/param', function(req, res, next) {
  res.send({
    code:0,
    message:'success',
    data:'get request with param:' + req.path,
  })
})

router.post('/param', function(req, res, next) {
  let body = req.body;
  res.send({
    code:0,
    message:'success',
    data:'post request with param:' + JSON.stringify(body),
  })
})

router.post("/video.VideoInformation", function(req, res, next) {
  console.log("/video.VideoInformation", req.body);

  res.send({
    code:200,
    message:'success',
    data:'/video.VideoInformation',
  });
});

router.get("/video.VideoInformationDel", function(req, res, next) {
  console.log("/video.VideoInformationDel", req.path);

  res.send({
    code:200,
    message:'success',
    data:'/video.VideoInformationDel',
  });
});

router.post("/video.ReportCameraStatus",function(req, res, next) {
  console.log("/video.ReportCameraStatus", req.body);

  res.send({
    code:200,
    message:'success',
    data:'/video.ReportCameraStatus',
  });
});

router.post("/video.ReportCameraQuality", function(req, res, next) {
  console.log("/video.ReportCameraQuality", req.body);

  res.send({
    code:200,
    message:'success',
    data:'/video.ReportCameraQuality',
  });
});

module.exports = router;
